package hottargui.config;

import hottargui.framework.Game;
import hottargui.framework.IllegalActionException;
import hottargui.framework.PlayerColor;
import hottargui.framework.Position;
import hottargui.framework.State;
import hottargui.framework.TarguiState;

public class AlphaNewGameState implements TarguiState {
	
	Game gameContext;
	
	public AlphaNewGameState(Game game)
	{
		this.gameContext = game;
	}
	
	@Override
	public boolean buy(int count, Position deploy) throws IllegalActionException {
		throw new IllegalActionException(this.getState());
	}

	@Override
	public State getState() {
		return State.newGame;
	}

	@Override
	public boolean move(Position from, Position to, int count) throws IllegalActionException {
		throw new IllegalActionException(this.getState());
	}

	@Override
	public void newGame() throws IllegalActionException {
		// Setup board
		gameContext.getGameObjectServer().getBoardStrategy().setupBoard(gameContext.getGameObjectServer().getGameData());
		
		gameContext.setState(gameContext.getFactory().getMoveState(gameContext));
	}

	@Override
	public void rollDie() throws IllegalActionException {
		throw new IllegalActionException(this.getState());
	}

	@Override
	public PlayerColor turnCard() throws IllegalActionException {
		throw new IllegalActionException(this.getState());
	}

	@Override
	public PlayerColor getWinner() throws IllegalActionException {
		throw new IllegalActionException(this.getState());
	}

}
